/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2008, 2009, 2010.

	This file is part of Maxsi Engine.

	Maxsi Engine is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi engine is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
	for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Engine. If not, see <http://www.gnu.org/licenses/>.

	MaxsiEngine.dll
	A general purpose C++ library for the Maxsi Technology Project.

	MaxsiCommand.h
	A function that converts a full command into smaller arguments

******************************************************************************/

#ifndef MaxsiCommand_H
#define MaxsiCommand_H

BeginMaxsiNamespace

#ifdef ME_USE_MULTIBYTE_STRING

	#define LPSTARTUPINFOM LPSTARTUPINFOW
	#define _STARTUPINFOM _STARTUPINFOW
	#define CreateProcessM CreateProcessW
	#define ChangeDir(Dir) _wchdir(Dir)
	#define GetCommandLineM GetCommandLineW

#else

	#define LPSTARTUPINFOM LPSTARTUPINFOA
	#define _STARTUPINFOM _STARTUPINFOA
	#define CreateProcessM CreateProcessA
	#define ChangeDir(Dir) _chdir(Dir)
	#define GetCommandLineM GetCommandLineA

#endif



LINK	bool	CommandLineToArg		(MESTR* Command, int* argc, char*** argv);
LINK	void	DeleteCommandLineArg	(int argc, MESTR** argv);
LINK	bool	RunProcess				(MESTR* Command, HWND ForegroundWindow = 0);
LINK	char*	GetWorkingDirectory		();
LINK	bool	WaitForProcessToClose	(DWORD ProcessID);

EndMaxsiNamespace

#endif
